package com.heima.controller;


import com.itcast.aliyunossspringbootautoconfigure.AliOSSUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@RequestMapping("/api/vm-service/sku")
public class CommonController {
    @Autowired
    AliOSSUtils aliOSSUtils;
    /**
     * 文件上传
     * **/
    @PostMapping("{fileUpload}")
    public String upload(@RequestParam("fileName") MultipartFile fileName) throws IOException {
           String url = aliOSSUtils.upload(fileName);
        return url;
    }
}